
namespace ShoppingCart.Business.Logic
{
	using System;
	using System.Collections.Generic;
	using ShoppingCart.Business.Entity;
	using ShoppingCart.DataAccess;

	/// <summary>
	/// Represents the Manager of Departamento.
	/// </summary>
	[Serializable]
	public class DepartamentoManager : Singleton<DepartamentoManager>
	{
		#region Methods

		/// <summary>
		/// Selects all records from the Departamento table.
		/// </summary>
        public IList<Departamento> Listar(bool mostrarTodo)
		{
			try
			{
				return DepartamentoData.Instancia.Listar(mostrarTodo);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Selects a single record from the Departamento table.
		/// </summary>
		public Departamento Obtener(int idDepartamento)
		{
			try
			{
				return DepartamentoData.Instancia.Obtener(idDepartamento);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Saves a record to the Departamento table.
		/// </summary>
		public int Agregar(Departamento departamento)
		{
			try
			{
				return DepartamentoData.Instancia.Agregar(departamento);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Updates a record in the Departamento table.
		/// </summary>
		public bool Modificar(Departamento departamento)
		{
			try
			{
				return DepartamentoData.Instancia.Modificar(departamento);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Deletes a record from the Departamento table by its primary key.
		/// </summary>
		public bool Eliminar(int idDepartamento)
		{
			try
			{
				return DepartamentoData.Instancia.Eliminar(idDepartamento);
			}
			catch (Exception) { throw; }
		}

		#endregion
	}
}
